<%@ include file="/WEB-INF/jsp/includes/include.jsp"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title>NoAssertions.com</title>
	<link rel="stylesheet" href="<fmt:message bundle="${mess}" key="baseUrl" />css/reset.css" />
	<link rel="stylesheet" href="<fmt:message bundle="${mess}" key="baseUrl" />css/text.css" />
	<link rel="stylesheet" href="<fmt:message bundle="${mess}" key="baseUrl" />css/960.css" />
	<link rel="stylesheet" href="<fmt:message bundle="${mess}" key="baseUrl" />css/nastyle.css" />
</head>
<%@ include file="/WEB-INF/jsp/includes/bodyheader.jsp"%>

		<!--  start center section -->
		<div id="centerSection" class="grid_12">	
			<div class="grid_2 alpha">
				<img src="<fmt:message bundle="${mess}" key="baseUrl" />img/spacer.gif"/>
			</div>
			<div class="grid_8">
				<h2>Search Results</h2>
				<c:if test="${empty riders && empty fits && empty comments}">
					<p>No results found. You might try to widen your search term or use a wildcard e.g. use handle* to find search terms handlebar, handle bar, handlebars, etc.</p>
				</c:if>	
					
				<c:if test="${not empty riders}">
					<h4>Name Search Results</h4>
					<div class="indent3">
						<c:forEach var="rider" items="${riders}">
							<ul>
								<li><b><a href="<fmt:message bundle="${mess}" key="servletUrl" />home?userid=${rider.userid}">${rider.firstname} ${rider.lastname}</a></b></li>							
								<li>Birth Date: ${rider.birthdate}</li>
								<li>Total Height: ${rider.totalbodyheight}</li>
								<li>Sternal Notch: ${rider.sternalnotch}</li>
								<li>Shoulder Width: ${rider.shoulderwidth}</li>					
								<li>Trunk: ${rider.trunk}</li>
								<li>Humerus: ${rider.humerus}</li>
								<li>Forearm: ${rider.forearm}</li>
								<li>Total Arm: ${rider.totalarm}</li>
								<li>Femur: ${rider.femur}</li>
								<li>Tibia: ${rider.tibia}</li>
								<li>Inseam: ${rider.inseam}</li>
								<li>Foot Length: ${rider.footlength}</li>				
								<c:choose>
									<c:when test="${empty rider.notes}">
									<li>Notes: No notes associated with this rider</li>
						          </c:when>
						          <c:otherwise>
									<li>Notes: ${rider.notes}</li>
						          </c:otherwise>
						        </c:choose>				
							</ul>
						</c:forEach>
					</div>
				</c:if>	
				
				<c:if test="${not empty fits}">
					<h4>Fit Search Results</h4>
					<div class="indent3">
						<c:forEach var="fit" items="${fits}">
								<ul>
									<li><b><a href="<fmt:message bundle="${mess}" key="servletUrl" />home?fitid=${fit.fitid}">View Fit</a></b></li>
									<li>${fit.firstname} ${fit.lastname}</li>
									<li>Date of Fit: <fmt:formatDate  value="${fit.dateofmeasurement}" type="date" dateStyle="full" pattern="yyyy-MM-dd"/></li>
									<li>Saddle Height: ${fit.saddleheight}</li>
									<li>Center to Bars: ${fit.centertobars}</li>
									<li>Center to Saddle: ${fit.centertosaddle}</li>
									<li>Floor to Saddle: ${fit.floortosaddle}</li>
									<li>Floor to Bars: ${fit.floortobars}</li>
									<c:choose>
										<c:when test="${empty fit.notes}">
											<li>Notes: No notes associated with this rider</li>
								       </c:when>
										<c:otherwise>
											<li>Notes: ${fit.notes}</li>
										</c:otherwise>
							        </c:choose>
							       </ul>
						</c:forEach>
					</div>
				</c:if>
				
				<c:if test="${not empty comments}">
					<h4>Comments Search Results</h4>
					<div class="indent3">
						<c:forEach var="comment" items="${comments}">
							<ul>
								<li><a href="<fmt:message bundle="${mess}" key="servletUrl" />home?fitid=${comment.fitid}">On
									<json:property name="commentcreated">
										<fmt:formatDate value="${comment.commentcreated}" type="date" dateStyle="full" pattern="EEEE, dd MMMM yyyy, HH:mm"/>
									</json:property>, ${comment.commenter} said: <p>${comment.comment}</a>
								</li>
							</ul>
						</c:forEach>
					</div>
				</c:if>
				
			</div>
			<div class="grid_2 omega">
			</div>
		</div>
		<div class="clear"></div>
		<!--  end center section -->
<%@ include file="/WEB-INF/jsp/includes/footer.jsp"%>